<%@page import="java.util.ArrayList"%>
<%@page import="com.caotv.wkreport.dao.Rooms"%>
<%@page import="java.util.List"%>
<%@page import="com.caotv.wkreport.dao.User"%>
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>

<html>
<head>
<title>利達ソフト</title>
<sx:head />
<sj:head />
</head>

<body>

	<div id="functionLabel">
		<p>Booking room</p>
	</div>

	<div id="bookRoomForm">
		<s:form action="bookingRoom" method="post" validate="true"
			theme="simple">
			<table>
				<tr>
					<td colspan="6"><s:actionerror /></td>
				</tr>
				<tr>
					<td colspan="6"><s:actionmessage /></td>
				</tr>
				<tr>
					<td colspan="6"><s:fielderror fieldName="roomId"></s:fielderror>
					</td>
				</tr>
				<tr>
					<td><s:label key="label.room"></s:label></td>
					<td colspan="5"><s:select list="listRooms" listKey="id"
							listValue="roomname" name="roomId" headerKey="-1"
							key="label.room" headerValue="Choose a room">
						</s:select></td>

				</tr>
				<tr>
					<td colspan="6"><s:fielderror fieldName="startDate"></s:fielderror>
					</td>
				</tr>
				<tr>
					<td><s:label key="label.startDate"></s:label></td>
					<td>
						<sj:datepicker id="startDate" displayFormat="mm/dd/yy"
							name="startDate" key="label.startDate" />
					</td>

					<td><s:label key="label.hour"></s:label></td>

					<td><s:select list="listHours" key="label.hour"
							name="startHour"></s:select></td>

					<td><s:label key="label.min"></s:label></td>

					<td><s:select list="#{'00':'00', '30':'30'}" name="startMin"
							key="label.min">
						</s:select></td>
				</tr>
				<tr>
					<td colspan="6"><s:fielderror fieldName="endDate"></s:fielderror>
					</td>
				</tr>
				<tr>
					<td><s:label key="label.endDate"></s:label></td>

					<td><sj:datepicker id="endDate" name="endDate"
							key="label.endDate" displayFormat="mm/dd/yy" /></td>
					<td><s:label key="label.hour"></s:label></td>
					<td><s:select list="listHours" name="endHour" key="label.hour"></s:select>
					</td>
					<td><s:label key="label.min"></s:label></td>
					<td><s:select list="#{'00':'00', '30':'30'}" name="endMin"
							key="label.min">
						</s:select></td>
				</tr>
				<tr>
					<td></td>
				</tr>
				<tr>
					<td><s:label key="label.description"></s:label></td>
					<td colspan="5"><s:textarea key="label.description"
							name="description"></s:textarea></td>
				</tr>
				<tr>
					<td colspan="6"><s:submit cssClass="button"
							key="label.register" align="center" /></td>
				</tr>
			</table>
		</s:form>
	</div>

	<s:if test="listBookingRoom.size() > 0">
		<div id="functionLabel">
			<p>
				Book info at
				<s:property value="startDate" />
			</p>
		</div>
			<table id="bookingInfo">
				<tr>
					<th width="100">Room name</th>
					<s:iterator value="listRooms" id="listRooms">
						<th width="150"><s:property value="roomname" /></th>
					</s:iterator>
				</tr>
				<s:iterator value="listMatrix" id="listMatrix" >
					<tr>
						<td class="rowheader"><s:property value="timeZone" /></td>
						<s:iterator value="row" id="row" var="element">
								<s:if test="%{#element == 'booked'}">
										<td class="booked"></td>
								</s:if>
								<s:else>
									<td></td>
								</s:else>
						</s:iterator>

					</tr>
				</s:iterator>
			</table>
	</s:if>
</body>